package matchthreegame.handlers;

import matchthreegame.extensions.MatchThreeGameZoneExtension;
import matchthreegame.utils.StoreManager;

import com.smartfoxserver.v2.entities.User;
import com.smartfoxserver.v2.entities.data.ISFSObject;
import com.smartfoxserver.v2.entities.data.SFSArray;
import com.smartfoxserver.v2.entities.data.SFSObject;
import com.smartfoxserver.v2.extensions.BaseClientRequestHandler;

public class GetStoreInfoRequestHandler extends BaseClientRequestHandler {

	public static final String STORE_PURCHASES_REWARDS = "SPR";
	public static final String STORE_UPGRADE_PRICES = "SUP";
	
	MatchThreeGameZoneExtension zoneExtension;
	
	@Override
	public void handleClientRequest(User sender, ISFSObject params) {

		zoneExtension = (MatchThreeGameZoneExtension)getParentExtension().getParentZone().getExtension();
				
		SFSArray upgradePriceSfsArray = StoreManager.getSFSUpgradePrices();
		SFSArray purchasesRewardsSfsArray = StoreManager.getSFSPurchaseRewards();
		
		SFSObject storeInfoSfsObject = new SFSObject();
		storeInfoSfsObject.putSFSArray(STORE_UPGRADE_PRICES, upgradePriceSfsArray);
		storeInfoSfsObject.putSFSArray(STORE_PURCHASES_REWARDS, purchasesRewardsSfsArray);
		
		zoneExtension.send(MatchThreeGameZoneExtension.CMD_GET_STORE_INFO, storeInfoSfsObject, sender);
		
	}

}
